/*
 * Jamus
 * Copyright (C) 2010 Jamus Team
 *
 * Jamus is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Jamus is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jamus.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __TRACK
#define __TRACK

#include <vector>
#include <boost/date_time/posix_time/posix_time_duration.hpp>

class Track
{
public:
	Track();
	Track(const std::string& fileName, const boost::posix_time::time_duration& duration);
	Track(const std::string& fileName, const boost::posix_time::time_duration& duration, const std::string& artist, const std::string& album, const std::string& title, int trackNumber);

	bool matches(const std::string& attribute, const std::string& value) const;

	const std::string& getFileName() const;
	void setFileName(const std::string& fileName);

	const boost::posix_time::time_duration& getDuration() const;
	void setDuration(const boost::posix_time::time_duration& duration);

	const std::string& getArtist() const;
	void setArtist(const std::string& artist);

	const std::string& getAlbum() const;
	void setAlbum(const std::string& album);

	const std::string& getTitle() const;
	void setTitle(const std::string& title);

	//! @return this track's track number, or 0 if unknown
	int getTrackNumber() const;
	void setTrackNumber(int trackNumber);

	bool operator==(const Track&) const;

private:
	std::string fileName;
	boost::posix_time::time_duration duration;
	std::string artist;
	std::string album;
	std::string title;
	int trackNumber;
};

#endif
